<template>
  <div class="mine">
    <!-- 我的页面的头部 -->
    <van-nav-bar>
      <template #right>
        <van-image
          :src="require('@/assets/mine-font/set.png')"
          width="23px"
          height="23px"
        />
      </template>
    </van-nav-bar>
    <!-- 头像部分以及用户信息 -->
    <router-link to="./mine/login">
      <div class="head-portraits">
        <!-- 头像 -->
        <van-image
          round
          width="60px"
          height="60px"
          :src="require('@/assets/mine-font/Head-Portraits.png')"
        />
        <div class="userphone">
          <p class="login">{{ phone }}</p>
        </div>
      </div>
    </router-link>
    <!-- <p>156****0820</p>
        <span>去完善<van-icon name="arrow" color="#3474BC" /></span> -->

    <!-- 家人/医生/优惠券 -->
    <ul class="mine-list">
      <li>家人<span>0</span></li>
      <li>医生<span>0</span></li>
      <li>优惠券<span>0</span></li>
    </ul>
    <!-- 健康vip -->
    <div class="health-vip">
      <router-link to="/home/mine/healthVip">
        <img
          src="@/assets/mine-font/health-vip.png"
          alt=""
          class="health-vip"
        />
      </router-link>
    </div>
    <!-- 我的订单 -->
    <div class="mine-order">
      <div class="order-content">
        <h2>
          我的订单<span>查看全部<van-icon name="arrow" color="#aaaaaa" /></span>
        </h2>
        <ul class="order-list">
          <li>
            <img src="@/assets/mine-font/registering.png" alt="" />
            <span>预约挂号</span>
          </li>
          <li>
            <img src="@/assets/mine-font/consult.png" alt="" />
            <span>咨询订单</span>
          </li>
          <li>
            <img src="@/assets/mine-font/store.png" alt="" />
            <span>商城订单</span>
          </li>
          <li>
            <img src="@/assets/mine-font/service.png" alt="" />
            <span>专科服务</span>
          </li>
        </ul>
      </div>
    </div>
    <!-- 广告图 -->
    <div class="advertisement">
      <img src="@/assets/mine-font/advertisement.png" alt="" />
    </div>
    <!-- 常用工具 -->
    <div class="mine-tool">
      <div class="tool-content">
        <h2>常用工具</h2>
        <van-grid :gutter="8" :border="false">
          <van-grid-item
            v-for="(item, index) in tabs"
            :key="index"
            :icon="item.img"
            :text="item.name"
            :to="item.url"
          />
        </van-grid>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tabs: [
        {
          name: "我的处方",
          img: require("@/assets/mine-font/recipe.png"),
          url: "./mine/404notfound",
        },
        {
          name: "新人福利",
          img: require("@/assets/mine-font/newbie.png"),
          url: "./mine/404notfound",
        },
        {
          name: "健康档案",
          img: require("@/assets/mine-font/file.png"),
          url: "./mine/404notfound",
        },
        {
          name: "我的收藏",
          img: require("@/assets/mine-font/collect.png"),
          url: "./mine/404notfound",
        },
        {
          name: "邀请分享",
          img: require("@/assets/mine-font/share.png"),
          url: "./mine/404notfound",
        },
        {
          name: "健康量表",
          img: require("@/assets/mine-font/CHQ.png"),
          url: "./mine/404notfound",
        },
        {
          name: "我的保险",
          img: require("@/assets/mine-font/Insurance.png"),
          url: "./mine/404notfound",
        },
        {
          name: "睡眠管理",
          img: require("@/assets/mine-font/Sleep.png"),
          url: "./mine/404notfound",
        },
        {
          name: "心肺康复",
          img: require("@/assets/mine-font/ACCV.png"),
          url: "./mine/404notfound",
        },
        {
          name: "号源提醒",
          img: require("@/assets/mine-font/warn.png"),
          url: "./mine/404notfound",
        },
        {
          name: "健康管理",
          img: require("@/assets/mine-font/health.png"),
          url: "./mine/404notfound",
        },
        {
          name: "使用激活码",
          img: require("@/assets/mine-font/activate.png"),
          url: "./mine/404notfound",
        },
        {
          name: "我的钱包",
          img: require("@/assets/mine-font/Wallet.png"),
          url: "./mine/Wallet",
        },
        {
          name: "联系客服",
          img: require("@/assets/mine-font/relation.png"),
          url: "./mine/404notfound",
        },
        {
          name: "常见问题",
          img: require("@/assets/mine-font/question.png"),
          url: "./mine/404notfound",
        },
        {
          name: "扫码支付",
          img: require("@/assets/mine-font/payment.png"),
          url: "./mine/404notfound",
        },
      ],
      phone: "",
    };
  },
  mounted() {
    this.phone = sessionStorage.getItem("phone") || "请登录";
  },
};
</script>

<style lang="less">
.mine {
  // 头像部分以及用户信息
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 56px;
  overflow-x: scroll;
  height: calc(100%-56px);
  // width: 375.2px;
  // white-space: nowrap;

  ::-webkit-scrollbar {
    width: 0 !important;
  }

  ::-webkit-scrollbar {
    width: 0 !important;
    height: 0;
  }
  .head-portraits {
    height: 60px;
    padding-left: 18px;
    display: flex;

    .userphone {
      .login {
        font-size: 24px;
        padding-top: 20px;
      }
      // 登录后手机号码部分
      p {
        width: 100%;
        height: 18px;
        font-size: 19px;
        font-weight: 900;
        color: #000000;
        line-height: 18px;
        margin: 0 12.5px;
        padding-top: 9.5px;
      }
      span {
        width: 53.5px;
        height: 29.5px;
        border: 1px solid #44a5dc;
        font-size: 12px;
        color: #94b8b8;
        text-align: center;
        border-radius: 3px;
        padding: 2px 4px;
        line-height: 29.5px;
        margin-left: 10.5px;
      }
    }
  }
  // 家人/医生/优惠券
  .mine-list {
    height: 49px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;

    li {
      font-size: 13px;
      color: #b7b7bb;

      span {
        padding-left: 7.5px;
        color: #000;
        font-weight: 500;
      }
    }
  }
  // 健康vip
  .health-vip {
    width: 100%;
    text-align: center;
    img {
      width: 350px;
      height: 47px;
    }
  }
  // 我的订单
  .mine-order {
    width: 100%;
    margin-top: 11px;
    display: flex;
    justify-content: center;
    .order-content {
      width: 348px;
      height: 124.5px;
      border-radius: 2.5px;
      box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.11);
      h2 {
        font-size: 18px;
        display: flex;
        justify-content: space-between;
        margin: 0;
        padding-top: 16px;
        padding-left: 10px;
        padding-right: 10px;
        span {
          font-size: 12px;
          color: #aaa;
          display: flex;
          align-items: flex-end;
          .van-icon {
            display: block;
            padding-bottom: 2px;
          }
        }
      }
      .order-list {
        width: 100%;
        display: flex;
        padding-top: 22px;
        justify-content: space-around;
        align-items: center;
        li {
          width: 70px;
          height: 60px;
          display: flex;
          flex-wrap: wrap;
          justify-content: center;
          align-items: center;
          img {
            width: 25px;
            height: 23px;
          }
          span {
            font-size: 13px;
            color: #888;
          }
        }
      }
    }
  }
  // 广告图
  .advertisement {
    width: 100%;
    text-align: center;
    margin-top: 16px;
    img {
      width: 351px;
      height: 80.5px;
    }
  }
  // 常用工具
  .mine-tool {
    width: 100%;
    margin-top: 11px;
    display: flex;
    justify-content: center;
    .tool-content {
      width: 348px;
      border-radius: 2.5px;
      box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.11);
      h2 {
        font-size: 18px;
        padding-left: 16px;
      }
    }
  }
}
</style>
